package com.ndp.fb.rdb.api;

import com.ndp.fb.rdb.model.Pager;
import com.ndp.fb.rdb.model.PixelId;
import com.ndp.fb.rdb.model.productmanage.FeedWeExt;
import com.ndp.fb.rdb.model.productmanage.ProductManage;
import com.ndp.fb.rdb.model.productmanage.ProductManageCondition;
import com.ndp.fb.rdb.model.productmanage.ProductManageExt;

import java.util.List;

/**
 * @Author: Evan on 12/30/2015  14:56.
 * Email: evan.wan@ndpmedia.com
 */
public interface ProductManageRdbService {

    Long save(ProductManage pm);

    //根据当前用户所属公司查询产品管理表  非删除的产品; name模糊匹配，可为空;
    List<ProductManage> findByUserIdAndName(Long orgId, String name);

    Pager<ProductManageCondition> findByUserIdAndName(Long orgId, String userId, String name, Integer firstResult, Integer pageSize);


    List<ProductManage> findByProductId(Long proId);

    ProductManage findByProductIdAndProductPlatform(Long productId, String productPlatform);

    List<ProductManage> findByProductNameAndOrgId(String prodName, Long orgId);

    List<ProductManage> findByOrgId(Long orgId);

    List<ProductManageExt> findEcCustomersWithFbAccountByUserId(String userId);

    List<Long> findFbAccountIdByUserIdAndProductId(String userId, String productId);

    ProductManage findById(Long id);

    ProductManage findByProductId(Long prodId, String userId);

    PixelId findFbPixelByProductId(Long productId);

    List<ProductManageExt> findEcCustomersByUserId(String userId);

    List<ProductManage> findByUserId(String userId);

    List<ProductManage> findAll();

    List<ProductManage> findAllByOrgId(Long orgId);

    List<FeedWeExt> findPmAndFeedAllByOrgId(Long orgId);
}
